package com.net.orders.fegin;

import com.caikun.model.common.Result;
import com.caikun.model.entity.ShoppingCar;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;

import java.util.List;

@Component
@FeignClient(name = "shopping-car-serve", path = "/shoppingCar")
public interface OrderShoppingCarFegin {
    /**
     * 根据 userId 查询购物车记录
     */
    @GetMapping("/feign/{userId}")
    public Result<List<ShoppingCar>> getshoppingCar(@PathVariable Integer userId);

    /**
     * 根据 userId 删除购物车记录
     */
    @DeleteMapping("/{userId}")
    public Result<String> deleteByUserId(@PathVariable Integer userId);
}
